package com.wry.io.service;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;

/**
 * @author     ：wry
 * @date       ：Created in 2021/6/23 10:23
 * @description：IO流测试用例
 * @version     :1.0
 * @modified By：
 */
public class IoService {

 public static void main(String[] args) throws Exception {
  //输入流
  InputStream inputStream = new FileInputStream(new File("C:\\Users\\Administrator\\Desktop\\lb_user_black_notice.xlsx"));
  byte[] bytes = inputStream.readAllBytes();
  System.out.println(bytes.length);
  FileOutputStream fileOutputStream = new FileOutputStream("C:\\Users\\Administrator\\Desktop\\2.xlsx");
  while (inputStream.read() != -1) {
   fileOutputStream.write(inputStream.readNBytes(inputStream.read()));
  }
  //输出流

//  fileOutputStream.write(bytes);

 }
}
